package com.paddyi.feignService;

import com.paddyi.feignService.FallBack.DocumentFallBack;
import com.paddyi.model.Document;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @program: paddyi
 * @description: feign的servie
 * @author: paddy
 * @create: 2019-08-05 10:03
 **/
@Service
@FeignClient(value = "paddyi-cms/document",fallback = DocumentFallBack.class)
public interface DocumentService {
    @RequestMapping(value = "/add", method= RequestMethod.POST)
    String add(@RequestBody Document document);

    @RequestMapping(value = "/edit", method= RequestMethod.POST)
    String edit(@RequestBody Document document);

    @RequestMapping(value = "/findAll", method= RequestMethod.GET)
    String findAll();

    @RequestMapping(value = "/findById", method= RequestMethod.GET)
    String findById(@RequestParam("id") Long ID);
}
